#include <stdio.h>
#include "linklistfun.h"

int main(int argc, const char *argv[])
{
	int choosenum;
	int headde=0;
	int tailde=0;
	link_node *H=creathead();
	while(1)
	{
		printf("*****1.headinsert  2.tailinsert  3.posinsert*****\n");
		printf("*****4.headdelete  5.taildelete  6.posdelete*****\n");
		printf("*****7.view        8.returnlist  9.exit      *****\n");
		printf(">>plz input choose  ");
		scanf("%d",&choosenum);
		switch(choosenum)
		{
			case 1:
				headinsert(H);
				break;
			case 2:
				tailinsert(H);
				break;
			case 3:
				posinsert(H);
				break;
			case 4:
				headde=headdelete(H);
				if(headde==-1)
				{
					printf("headdelete error\n");
				}
				else
				{
					printf("headdelete success\n");
				}
				break;
			case 5:				
				tailde=taildelete(H);
				if(tailde==-1)
				{
					printf("taildelete error\n");
				}
				else
				{
					printf("taildelete success\n");
				}
				break;
			case 6:
				posdelete(H);
				break;
			case 7:
				view(H);
				break;
			case 8:
				returnlist(H);
				break;
			case 9:
				return 0;
				break;
/*
			case 10:
				return 0;
				break;
*/
			default:
				break;
		}
	}
	return 0;
}
